package masterjava.common.context;

import masterjava.common.configuration.AppSetting;

/**
 * @author GKislin
 *         Date: 27.10.2008
 *         <p/>
 *         JEE context
 *         JeeContext.init() must be called in every JavaEE artifact
 *         Call only from place where callback from AS occure
 *         (injection, ServletContextListener.contextInitialized(), @PostConstruct )
 */
public class JeeContext extends AppContext {

    public static void init() {
        new JeeContext();
        LOGGER.info("\n\n+++++++  INIT APPLICATION  " + AppSetting.get().APP_ID.get() + "( " + AppSetting.get().VSC_REVISION.get() + " ) ++++++++++++");
    }

//    @Override
//    public void registerMBean(IStateBean item, String name) throws Exception {
//        JmxUtil.registerMBean(item, name);
//    }
//
//    @Override
//    public void unregisterMBean(IStateBean item, String name) {
//        JmxUtil.unregisterMBean(item, name);
//    }
//
//    @Override
//    public DataSource getDataSource(Scheme scheme) throws Exception {
//        LOGGER.info("lookup DataSource " + scheme.getJdbcName());
//        Context ctx = new InitialContext();
//        return (DataSource) ctx.lookup(scheme.getJdbcName());
//    }
}
